package com.ws.admin.action;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;
import com.ws.dto.LoginFormBean;
import com.ws.service.LoginService;

@Component("aLoginAction")
public class ALoginAction extends ActionSupport {
	
	private LoginService loginService;

	@Resource(name="adminLoginServiceImpl")
	public void setLoginService(LoginService loginService) {
		this.loginService = loginService;
	}
	
	private LoginFormBean lfb = new LoginFormBean();;

	public LoginFormBean getLfb() {
		return lfb;
	}

	public void setLfb(LoginFormBean lfb) {
		this.lfb = lfb;
	}
	
	@Override
	public String execute() throws Exception {
		return loginService.doLogin(lfb.getUsername(),lfb.getPassword());
		//return loginService.doLogin("admin","123");
	}
	
}
